import { DatePicker } from 'antd';
import { SchemaManageAPI } from '../../type';

interface IPropsType {
  id?: string;
  value?: any;
  onChange?: any;
  opt: SchemaManageAPI.ISearchList;
  type: string;
  disabledDate?: boolean | undefined;
}

export const SearchDatePicker: React.FC<IPropsType> = (props) => {
  return (
    <DatePicker
      picker={props?.opt?.picker || 'week'}
      style={{ width: '100%' }}
      placeholder={props?.opt?.placeholder || undefined}
      onChange={props?.onChange}
      value={props.value ?? ''}
      defaultValue={props?.opt?.defaultValue}
      allowClear={props?.opt?.allowClear}
      disabledDate={props?.opt?.disabledDate}
    />
  );
};
